import java.util.HashMap;
import java.util.Map;

public class Solution1287 {
    public int findSpecialInteger(int[] arr) {
        Map<Integer,Integer> map=new HashMap<>();
        for (int i : arr) {
            map.putIfAbsent(i,0);
            map.put(i,map.get(i)+1);
        }
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            if (entry.getValue()*4>arr.length){
                return entry.getKey();
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1287().findSpecialInteger(new int[]{1,2,2,6,6,6,6,7,10}));
    }
}
